package com.wan.rabbitmq.mq;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 *
 * @author 万明宇 on 2018/3/5.
 */
@Component
public class FanoutSender {

    @Autowired
    private AmqpTemplate rabbTemplate;

    public void send(){
        String msgString="fanoutSender :hello i am hzb";
        System.out.println(msgString);
        rabbTemplate.convertAndSend("fanoutExchange","abcd.ee",msgString);
    }

}
